//
//  SZCalendarCell.m
//  SZCalendarPicker
//
//  Created by Stephen Zhuang on 14/12/1.
//  Copyright (c) 2014年 Stephen Zhuang. All rights reserved.
//
#define UISCREEN_WIDTH ([[UIScreen mainScreen]bounds].size.width)
#define UISCREEN_HEIGHT ([[UIScreen mainScreen]bounds].size.height)
//文字大小
#define kScreenWidthRatio  (UISCREEN_WIDTH / 375)
#define kScreenHeightRatio (UISCREEN_HEIGHT / 667)
#define AdaptedWidthValue(x)  (ceilf((x) * kScreenWidthRatio))
#define AdaptedHeightValue(x) (ceilf((x) * kScreenHeightRatio))
#define SystemFontWithSize(R)     [UIFont systemFontOfSize:(AdaptedWidthValue(R))]
#define SystemFontWithWeightSize(R)      [UIFont systemFontOfSize:(AdaptedWidthValue(R)) weight:1]

#import "SZCalendarCell.h"

@implementation SZCalendarCell
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self != nil) {
        [self createSub];
    }
    return self;
}
-(void)createSub{
    _dateLabel = [[UILabel alloc] initWithFrame:CGRectMake((self.bounds.size.width-20*kScreenWidthRatio)/2, self.bounds.origin.y, 20*kScreenWidthRatio, 20*kScreenWidthRatio)];
    [_dateLabel setTextAlignment:NSTextAlignmentCenter];
    [_dateLabel setFont:[UIFont systemFontOfSize:14]];
    [self addSubview:_dateLabel];
    
    self.progress = [[UIProgressView alloc]initWithFrame:CGRectMake((self.bounds.size.width-25*kScreenWidthRatio)/2, _dateLabel.frame.origin.y+_dateLabel.frame.size.height+5*kScreenHeightRatio, 25*kScreenWidthRatio, 10)];
    self.progress.trackTintColor = [UIColor colorWithRed:60/255.0 green:186/255.0 blue:146/255.0 alpha:1];
    self.progress.tintColor = [UIColor colorWithRed:236/255.0 green:236/255.0 blue:236/255.0 alpha:1] ;
    self.progress.hidden = YES;
    CGAffineTransform transform = CGAffineTransformMakeScale(1.0f, 2.0f);
    self.progress.transform = transform;//设定宽高
    self.progress.layer.cornerRadius = 2.0;
    self.progress.layer.masksToBounds = YES;
    [self addSubview:self.progress];
    
}
@end
